package com.seedwill.common.view;

import java.util.List;

/**
 * 节点视图
 * 
 * @author kdyi
 */
public class NodeView implements java.io.Serializable {
	
	private Object id;
	
	public Object getId() {
		return id;
	}

	public void setId(Object id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	private boolean asRoot;

	public boolean isAsRoot() {
		return asRoot;
	}

	public void setAsRoot(boolean asRoot) {
		this.asRoot = asRoot;
	}

	public boolean hasChildren(){
		return childrenNode!=null && childrenNode.size()>0;
	}
	
	public Object getNodeData() {
		return nodeData;
	}

	public void setNodeData(Object nodeData) {
		this.nodeData = nodeData;
	}

	public NodeView getParentNode() {
		return parentNode;
	}

	public void setParentNode(NodeView parentNode) {
		this.parentNode = parentNode;
	}

	public List<NodeView> getChildrenNode() {
		return childrenNode;
	}

	public void setChildrenNode(List<NodeView> childrenNode) {
		this.childrenNode = childrenNode;
		if(this.childrenNode!=null && this.childrenNode.size()>0){
			this.asRoot = true;
		}else{
			this.asRoot = false;
		}
	}

	private String name;
	
	private String icon;
	
	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	private Object nodeData;

	private NodeView parentNode; 
	
	private List<NodeView> childrenNode;
	
}
